-
Notifications
You must be signed in to change notification settings - Fork 11
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add new map filters #1090
Add new map filters #1090
Conversation
You can maybe address #1078 as well in this PR since we're touching at the main page? |
Build succeeded and deployed at https://aqualink-app-1090.surge.sh |
packages/api/src/utils/site.utils.ts
Outdated
.select('survey.site_id', 'siteId') | ||
.addSelect('json_agg(distinct rco.organism)', 'organism') | ||
.leftJoin('reef_check_organism', 'rco', 'rco.survey_id = survey.id') | ||
.where('rco.s1 > 0') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would it simplify a bit to so something like this? .where('(rco.s1 + rco.s2 + rco.s3 + rco.s4) > 0')
Or maybe not? Not sure if it would make it faster
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would assume that with multiple simple predicates (s1 > 0 or s2 > 0
) postgres would be able to do more optimizations and therefore it would be faster, but after analyzing the query plan and the execution time it seems they are equivalent. It likely won't make it faster or slower, but it would make it simpler, so let's go with your suggestion.
Add new map filters figma. Closes #1066
reefCheckData
property to each site in/sites
response which includes some attributes for the site in order to use them for filtering in UI.filters
are in state and displayedSites is a selector now.Other: